package com.mybatis.generator.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.mybatis.generator.model.Admin;
import com.mybatis.generator.service.AdminService;

@Controller
@RequestMapping("/admin")
public class AdminController {
	
	@Autowired
	private AdminService adminService;

	@RequestMapping("/get")
	public ModelAndView mvView() {
		ModelAndView mv = new ModelAndView();
		Admin admin = adminService.findAdmin(1);
		mv.addObject("admin", admin);
		mv.setViewName("admin");
		return mv;
	}
}

